<template>
    <div class="goodsDetails">
        <div class="message_header">
           <div class="message_header_con">
                <span class="goBack" @click="goBack">&lt;</span>
                <div class="message_header_r">
                    <div class="shop_car">
                        <img src="../../static/img/shop_car.png" alt="" class="share_png">
                        <i>4</i>
                    </div>
                    <img src="../../static/img/more.png" alt="" class="share_png">
                </div> 
           </div>
       </div>
        <el-carousel :interval="5000" arrow="always">
            <el-carousel-item v-for="item in 4" :key="item">
            <h3>{{ item }}</h3>
            </el-carousel-item>
        </el-carousel>
        <div class="goodsPrice">
            <div class="goodsPrice_con">
                <p class="goodsName">{{goodsDetails.name}}</p>
                <div class="goodsBuy">
                    <p class="itemPrice">&yen;{{goodsDetails.price}}</p>
                    <el-input-number v-model="num1" @change="handleChange" :min="1" :max="goodsDetails.stockNum" label="描述文字"></el-input-number>
                </div>
            </div>
        </div>
        <p class="stockNum">库存数量：{{goodsDetails.stockNum}}</p>
        <p class="jiange"></p>
        <div class="brief_introduction">
            <p class="brief_introduction_title">商品简介</p>
            <div class="goods_img">
                <p class="goods_img_tit">品相如图</p>
                <ul class="goods_img_ul">
                    <li class="goods_img_li" v-for="(item,index) in goodsDetails.imgUrl" :key="index"></li>
                </ul>
                <div class="goods_assess">
                    <p class="goods_assess_tit">【商品评价】</p>
                    <div class="goods_assess_con">
                        <div class="goods_assess_img">
                            <img src="../../static/img/five_stars_man.png" alt="">
                            <img src="../../static/img/five_stars_kong.png" alt="">
                            <img src="../../static/img/five_stars_kong.png" alt="">
                            <img src="../../static/img/five_stars_kong.png" alt="">
                            <img src="../../static/img/five_stars_kong.png" alt="">
                        </div>
                        <p class="goods_assess_r">
                            <span>{{goodsDetails.goodsScore}}</span>
                            <span>分评分</span>
                        </p>
                    </div>
                </div>
            </div>
        </div>
         <p class="jiange"></p>
         <div class="like_this">
             <p class="like_this_title">猜你喜欢</p>
         </div>
        <ul class="bottom_tool">
            <li class="has_img">
                <img src="../../static/img/goods_info_chat.png" alt="">
                <p>私信</p>
            </li>
            <li class="has_img">
                <img src="../../static/img/goods_info_store.png" alt="">
                <p>店铺</p>
            </li>
            <li class="has_img">
                <img src="../../static/img/goods_info_attention_unclick.png" alt="">
                <p>收藏</p>
            </li>
            <li class="has_noimg shop_car">
                <p>加入购物车</p>
            </li>
            <li class="has_noimg settlement">
                <p>去结算</p>
            </li>
        </ul>
    </div>
</template>
<script>
export default {
    name:'goodsDetails',
    data(){
        return{
            goodsDetails:{
                name:'泸州老窖',
                price:1100,
                stockNum:45,
                imgUrl:[1,2],
                goodsScore:5
            },
            num1: 1,
        }
    },
    methods:{
         handleChange(value) {
            console.log(value);
        },
        goBack(){
            this.$router.go(-1)
        }
    }
}
</script>
<style lang="less" scoped>
@import url(../assets/less/public.less);
.goodsDetails{
    .message_header{
        @font16();
        @height();
        background: transparent;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 3;
        .message_header_con{
            @width();
             @flex();
             @justify4();
            .goBack{
                @goBack();
            }
            .message_title{
                flex-grow: 1;
                @font16();
            }
            .share_png{width: 25px;}
            .message_header_r{
                @flex();
                @justify4();
                width: 60px;
                .shop_car{
                    position: relative;
                    i{
                        position: absolute;
                        display: block;
                        width: 14px;
                        height: 14px;
                        background: @config-bg;
                        color: #ffffff;
                        text-align: center;
                        line-height: 14px;
                        @font12();
                        right: 0;
                        top: 0;
                        border-radius:14px; 
                        font-style: normal;
                    }
                }
            }
        }
    }
    /deep/ .el-carousel__container{
        height: 150px;
        .el-carousel__item{
            h3 {
                color: #475669;
                font-size: 18px;
                opacity: 0.75;
                line-height: 150px;
                margin: 0;
            }
        } 
        
        .el-carousel__item:nth-child(2n) {
            background-color: #99a9bf;
        }
        
        .el-carousel__item:nth-child(2n+1) {
            background-color: #d3dce6;
        }
    }
    .goodsPrice{
        border-bottom:1px solid #cccccc;
        .goodsPrice_con{
            @width();
            margin: 15px auto;
            
            .goodsName{
                        @font16();
                        text-align: left;
            }
            .goodsBuy{
                @flex();
                @justify4();
                margin: 1em 0;
                .itemPrice{
                    color: @config-bg;
                    @font16();
                }
                /deep/ .el-input-number{
                    width: 110px;
                    height: 20px;
                    line-height: 20px;
                    span{
                        width: 20px;
                        border: none;
                        background: #cccccc;
                        color: @config-bg2;
                        font-weight: bold;
                        border-radius: 3px;
                        
                    }
                    .el-input{
                        padding-top: 1px;
                        .el-input__inner{
                            border: none;
                            background: #eeeeee;
                            height: 20px;
                            line-height: 20px;
                            padding: 0;
                            width: 60px;
                            border-radius: 2px;
                        }
                    }
                }
            }
        }
    }
    .stockNum{
        @font14();
        text-align: left;
        box-sizing: border-box;
        padding: 1em 3.125%;
        color: #bbbbbb;
    }
    .jiange{height: 1em;background: #eeeeee;}
    .brief_introduction{
        .brief_introduction_title{
            padding: 0.6em 3.125%;
            @font16();
            border-bottom: 1px solid #cccccc;
            text-align: left;
        }
    }
    .goods_img{
        padding: 1em 3.125%;
        .goods_img_tit{
            text-align: left;
            margin-bottom: 1em;
            @font12();
        }
        .goods_img_ul{
            .goods_img_li{
                margin-bottom: 10px;
                background: @config-bg;
                height: 150px;
            }
        }
        .goods_assess{
            .goods_assess_tit{
                text-align: left;
                margin-bottom: 0.8em;
            }
            .goods_assess_con{
                @flex();
                @justify4();
                .goods_assess_img{
                    img{
                        width: 25px;
                    }
                }
            }
        }
    }
    .like_this{
        padding-bottom: 60px;
        .like_this_title{
            padding: 1em 0 1em 3.125%;
            text-align: left;
            box-sizing: border-box;

        }
    }
    .bottom_tool{
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50px;
        @flex();
        @justify4();
        background: @config-bg2;
        li{
            flex-grow: 1;
            img{
                width: 25px;
            }
        }
        .has_img{
            color: #aaaaaa;
        }
        .has_noimg{
            flex-grow: 2;
            color:@config-bg2;
            height: 50px; 
            p{
                height: 50px;
                line-height: 50px;
            }
        }
        .shop_car{
            background: #f15c49;
        }
        .settlement{
            background: @config-bg;
        }
    }
}
</style>

